package com.mowh.gof23.structural.patterns.decorator;

/**
 * @author mowh1gd
 * @create 2023/10/25 14:20
 */
public class StringDisplay extends Display{
    private String aString;

    public StringDisplay(String aString) {
        this.aString = aString;
    }

    @Override
    public int getColumns() {
        return aString.getBytes().length;
    }

    @Override
    public int getRows() {
        return 1;
    }

    @Override
    public String getRowText(int row) {
        if (row ==0) {
            return aString;
        } else {
            return null;
        }
    }
}
